Rails.application.routes.draw do
  # 用户管理模块路由
  post 'users/register', to: 'users#create'
  post 'users/login', to: 'users#login'
  get 'users/auto_login', to: 'users#auto_login'
  post 'users/logout', to: 'users#logout' # logout user
  post 'users/update', to: 'users#update'
  post 'users/reset_pwd', to: 'users#reset_pwd'
  post 'users/destroy', to: 'users#destroy'
  get 'users/:username', to: 'users#view'
  get 'user_by_id/:id', to: 'users#view_id'

  # 活动部分
  get '/users/:username/activities', to: 'activities#user_acts'
  get '/activities', to: 'activities#index'
  get '/activities/:activity_id', to: 'activities#show'
  get '/activities/:activity_id/users', to: 'activities#users'
  post '/activities/create', to: 'activities#create'
  post '/activities/delete_act', to: 'activities#delete_act'
  post '/activities/update', to: 'activities#update'
  post '/activities/edit', to: 'activities#edit'
  post '/activities/joinact', to: 'activities#joinact'
  post '/activities/leaveact', to: 'activities#leaveact'
  post '/activities/userdetail', to: 'activities#userdetail'
  post '/activities/likeit', to: 'activities#likeit'
  post '/activities/recommendation', to: 'activities#recommendation'
  post '/activities/sortclass', to: 'activities#sortclass'
  post '/welcome/sortclass', to: 'activities#sortclass'
  post '/activities/showclass', to: 'activities#showclass'
  post '/activities/showclass_other', to: 'activities#showclass_other'
  post '/activities/search', to: 'activities#search'

  # 评论相关
  get '/activities/:activity_id/comments', to: 'activities#show_comments'
  post '/activities/:activity_id/push_comment', to: 'activities#push_comment'
  post '/activities/edit_comment/:comment_id', to: 'activities#edit_comment'
  post '/activities/destroy_comment/:comment_id', to: 'activities#destroy_comment'
end
